<template>
	<view class="my-goods" @click="active(item)">
		<view class="pic">
			<image class="goods-image" :src="item.image" mode="aspectFill"></image>
			<!-- <view class="goods-price">￥{{item.price}}</view> -->
		</view>
		<view class="content">
			<view class="goods-name v-ellip-2">
				{{item.store_name}}
			</view>
			<view class="goods-intro v-ellip-2" v-if="item.intro!=null">
				{{item.intro}}
			</view>
			<view class="goods-xinghao v-ellip-2">
				<text v-if="item.model != '' || item.model != null">{{item.model}}</text> <text v-if="item.model != '' && item.wear_txt != null" class="goods-wearLine"> | </text> <text v-if="item.wear_txt != null" class="goods-wear">{{item.wear_txt}}</text>
			</view>
<!-- 			<view class="goods-wear v-ellip-2">
				{{item.wear_txt}}
			</view> -->

			<view class="goods-otprice v-ellip-2">
				市场价: {{item.ot_price}}
			</view>
			<view class="goods-price1 v-ellip-2">
				<text class="goods-priceicon">￥</text> {{item.price}}   <text v-if="item.need_num>0" class="goods-price2">{{item.need_num}}人想要</text>
			</view>

			<view class="user-info" v-if="item.user">
				<image class="avatar" :src="item.user.avatar||''" mode="widthFix"></image>
				<view class="nickname">{{item.user.nickname||''}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			item:{
				type: Object,
				default: function(){return {}}
			}
		},
		methods:{
			active(item){
				this.$emit("active", item.product_id || item.id);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my-goods{
		width: 335rpx;
		margin-bottom: 35rpx;
		.pic{
			position: relative;
			.goods-image{
				border-radius: 10rpx;
				width: 335rpx;
				height: 400rpx;
				// border-radius: 20rpx;
				border: 1px solid #ccc;
			}
			.goods-price{
				position: absolute;
				right: 20rpx;
				bottom: 20rpx;
				background-color: #000;
				border-radius: 10rpx;
				padding: 4rpx 10rpx;
				color: #fff;
			}
		}
		.content{
			.goods-name{
				width: 100%;
				font-size: 28rpx;
				margin-top: 15rpx;
				color: #333;
			}
			.goods-xinghao{
				width: 100%;
				font-size: 24rpx;
				margin-top: 10rpx;
				color: #666;
			}
			.goods-wear{
				width: 100%;
				font-size: 24rpx;
				margin-top: 10rpx;
				color: #333;
			}
			.goods-wearLine{
				display: inline-block;
				margin: 0 15rpx;
				color: #999;
			}

			.goods-price1{
				width: 100%;
				font-size: 38rpx;
				margin-top: 10rpx;
				font-weight: 600;
				color: #FF4848;
			}
			.goods-priceicon{
				width: 100%;
				font-size: 24rpx;
				margin-top: 10rpx;
				font-weight: 400;
				color: #FF4848;
			}
			.goods-price2{
				font-size: 24rpx;
				// margin-top: 15rpx;
				font-weight: 400;
				color: #666;
				margin-left: 25rpx;
			}
			.goods-otprice{
				width: 100%;
				font-size: 24rpx;
				margin-top: 10rpx;
				color: #666;
			}
			.goods-intro{
				width: 100%;
				font-size: 24rpx;
				margin-top: 10rpx;
				color: #666;
			}
			.user-info{
				display: flex;
				align-items: center;
				margin-top: 15rpx;
				.avatar{
					width: 50rpx;
					border-radius: 50%;
				}
				.nickname{
					color: #999;
					margin-left: 10rpx;
				}
			}
		}

	}
</style>